import { getCartNumApi } from '../../api/cart'
const cartStore = {
  state: {
    num: 0
  },
  namespaced: true,
  getters: {
    num: state => state.num
  },
  mutations: {
    changeNum (state, res) {
      state.num = res.data;
    }
  },
  actions: {
    async getCartNumAction ({ commit }) {
      var res = await getCartNumApi()
      console.log(res)
      commit("changeNum", res)
    }
  }
}
export default cartStore